# Use the following on IRIX 6.5 and Linux 2.4
# Last tested with p15.06.01
#
ROOTLIBS = `root-config --libs`
OPTCOMP = `root-config --cflags`

SPECIALFLAGS= --exceptions
#CFLAGS = -iquote- -iquote../ -iquote.
LFLAGS =

RCXX = $(CFLAGS) $(ROOTCFLAGS)
DBG = -g -L -O
#LHAPDFLIB =/D0/ups/lhapdf/Linux-2-4/v1-2/lib/libLHAPDF-evlcteq.a /D0/ups/lhapdf/Linux-2-4/v1-2/lib/libLHAPDF-evlcteq_g.a /D0/ups/lhapdf/Linux-2-4/v1-2/lib/libLHAPDF-qcdnum.a /D0/ups/lhapdf/Linux-2-4/v1-2/lib/libLHAPDF-qcdnum_g.a
G2CLIB = /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/libg2c.so
CC = g++ ${DBG} $(RCXX) $(OPTCOMP)
F77 = f77

all: main_CBNTanalyser

main_CBNTanalyser: main_CBNTanalyser.o CBNTanalyser.o CBNTanalyser_Dict.o
	$(CC) main_CBNTanalyser.o CBNTanalyser.o CBNTanalyser_Dict.o $(ROOTLIBS) -o main_CBNTanalyser.exe

main_CBNTanalyser.o: main_CBNTanalyser.cpp
	$(CC) -c main_CBNTanalyser.cpp -o main_CBNTanalyser.o

CBNTanalyser.o: CBNTanalyser.cpp CBNTanalyser.h
	$(CC) -c CBNTanalyser.cpp -o CBNTanalyser.o


CBNTanalyser_Dict.cxx: CBNTanalyser.h
	rootcint -f CBNTanalyser_Dict.cxx -c CBNTanalyser.h

CBNTanalyser_Dict.o: CBNTanalyser_Dict.cxx
	$(CC) -c CBNTanalyser_Dict.cxx -o CBNTanalyser_Dict.o

clean:
	\rm -f *.o
	\rm -fr fortran/*.o
	\rm -fr *~
	\rm -fr CBNTanalyser_Dict.h
	\rm -fr CBNTanalyser_Dict.cxx
	\rm -fr main_CBNTanalyser.exe
	\rm -fr look_logbook.*
	\rm -fr *~
